<?php
class Admin_GroupModel extends Model{ public function add($zym_8) { return $this->insert($zym_8); } public function edit($zym_8) { $zym_9=$this->update($zym_8); dc::refresh('admin_group',$zym_8['id']); return $zym_9; } public function del($zym_7) { $zym_5=$this->where($zym_7)->field('id')->select(); foreach($zym_5 as $zym_6){ dc::del('admin_group',$zym_6['id']); } $this->where($zym_7)->delete(); } public function getlist() { $zym_5=(array)$this->select(); foreach($zym_5 as &$zym_6){ $zym_6['create_username']=dc::get('user',$zym_6['create_user_id'],'name'); $zym_6['update_username']=dc::get('user',$zym_6['update_user_id'],'name'); $zym_6['url_edit']=U('admin.group.edit',array('id'=>$zym_6['id'])); $zym_6['create_time']=$zym_6['create_time']?date('Y-m-d H:i',$zym_6['create_time']):''; $zym_6['update_time']=$zym_6['update_time']?date('Y-m-d H:i',$zym_6['update_time']):''; } return $zym_5; } }
?>